import os

import pandas
from flask import (Blueprint, request, send_from_directory)

bp = Blueprint('download',__name__, url_prefix='/download')

@bp.route('', methods = ['POST'])
def donwload():
    data = request.json.get('data')

    df = pandas.DataFrame(data)

    csv = df.to_csv(index=False)

    return{
        'code': 200,
        'data': csv,
        'msg': '获取成功',
    }

